using System;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Security;
using ns16;
using ns20;

namespace Newtonsoft.Json.Serialization
{
	public class JsonObjectContract : JsonContainerContract
	{
		private bool? nullable_4;

		[CompilerGenerated]
		private MemberSerialization memberSerialization_0;

		[CompilerGenerated]
		private Required? nullable_5;

		[CompilerGenerated]
		private JsonPropertyCollection jsonPropertyCollection_0;

		[CompilerGenerated]
		private JsonPropertyCollection jsonPropertyCollection_1;

		[CompilerGenerated]
		private ConstructorInfo constructorInfo_0;

		[CompilerGenerated]
		private ConstructorInfo constructorInfo_1;

		[CompilerGenerated]
		private ExtensionDataSetter extensionDataSetter_0;

		public MemberSerialization MemberSerialization
		{
			[CompilerGenerated]
			get
			{
				return memberSerialization_0;
			}
			[CompilerGenerated]
			set
			{
				memberSerialization_0 = value;
			}
		}

		public Required? ItemRequired
		{
			[CompilerGenerated]
			get
			{
				return nullable_5;
			}
			[CompilerGenerated]
			set
			{
				nullable_5 = value;
			}
		}

		public JsonPropertyCollection Properties
		{
			[CompilerGenerated]
			get
			{
				return jsonPropertyCollection_0;
			}
			[CompilerGenerated]
			private set
			{
				jsonPropertyCollection_0 = value;
			}
		}

		public JsonPropertyCollection ConstructorParameters
		{
			[CompilerGenerated]
			get
			{
				return jsonPropertyCollection_1;
			}
			[CompilerGenerated]
			private set
			{
				jsonPropertyCollection_1 = value;
			}
		}

		public ConstructorInfo OverrideConstructor
		{
			[CompilerGenerated]
			get
			{
				return constructorInfo_0;
			}
			[CompilerGenerated]
			set
			{
				constructorInfo_0 = value;
			}
		}

		public ConstructorInfo ParametrizedConstructor
		{
			[CompilerGenerated]
			get
			{
				return constructorInfo_1;
			}
			[CompilerGenerated]
			set
			{
				constructorInfo_1 = value;
			}
		}

		public ExtensionDataSetter ExtensionDataSetter
		{
			[CompilerGenerated]
			get
			{
				return extensionDataSetter_0;
			}
			[CompilerGenerated]
			set
			{
				extensionDataSetter_0 = value;
			}
		}

		internal bool Boolean_0
		{
			get
			{
				if (!nullable_4.HasValue)
				{
					nullable_4 = false;
					if (ItemRequired.GetValueOrDefault(Required.Default) != 0)
					{
						nullable_4 = true;
					}
					else
					{
						foreach (JsonProperty property in Properties)
						{
							if (property.Required != 0 || (((uint?)property.DefaultValueHandling & 2u) == 2 && property.Writable))
							{
								nullable_4 = true;
								break;
							}
						}
					}
				}
				return nullable_4.Value;
			}
		}

		public JsonObjectContract(Type underlyingType)
			: base(underlyingType)
		{
			enum15_0 = Enum15.Object;
			Properties = new JsonPropertyCollection(base.UnderlyingType);
			ConstructorParameters = new JsonPropertyCollection(base.UnderlyingType);
		}

		[SecuritySafeCritical]
		internal object method_5()
		{
			if (!Class140.Boolean_1)
			{
				throw new JsonException("Insufficient permissions. Creating an uninitialized '{0}' type requires full trust.".smethod_0(CultureInfo.InvariantCulture, type_0));
			}
			return FormatterServices.GetUninitializedObject(type_0);
		}
	}
}
